<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bluetooth LE Mesh Library: Mesh OnOff Server</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Bluetooth LE Mesh Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group__wiced__bt__mesh__onoff__server.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Mesh OnOff Server<div class="ingroups"><a class="el" href="group__wiced__bt__mesh.html">LE Mesh</a> &raquo; <a class="el" href="group__wiced__bt__mesh__models.html">Mesh Models Library API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>The AIROC Mesh OnOff Server module of the Mesh Models library provides a way to implement functionality for the devices that can be controlled using a simple On/Off switch, aka On/Off client. </p>
<p>The OnOff Server module is typically not used by a target applications. It is used by other modules that extend OnOff functionality. A simple example is a Power Plug application. Instead of using OnOff module, the application uses Power On/Off, which in addition to OnOff provides On Power Up behavior, i.e. the library saves in the NVRAM configuration of the state required when device is powered up and controls application accordingly. Similarly, an application for dimmable light uses Light Lightness module. If peer sends OnOff command, the application receives a callback from the Light Lightness module that the lightness is set to zero.</p>
<p>To use the OnOff Server, on startup an application or a module that extends the OnOff functionality should call wiced_bt_mesh_model_onoff_server_init function providing the callback that will be executed when an OnOff request is received to turn the device on or off.</p>
<p>The module which extends OnOff server should call the wiced_bt_mesh_model_onoff_changed function when the OnOff state of the device is changed locally. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga9edfe8c8fd00ec622586f851f1735c18"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__server.html#ga9edfe8c8fd00ec622586f851f1735c18">WICED_BT_MESH_MODEL_ONOFF_SERVER</a></td></tr>
<tr class="memdesc:ga9edfe8c8fd00ec622586f851f1735c18"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mesh OnOff Server Device.  <a href="#ga9edfe8c8fd00ec622586f851f1735c18">More...</a><br /></td></tr>
<tr class="separator:ga9edfe8c8fd00ec622586f851f1735c18"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga2258b6d7a8870b9d5e45cb31aad8ab9b"><td class="memItemLeft" align="right" valign="top">typedef void()&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__server.html#ga2258b6d7a8870b9d5e45cb31aad8ab9b">wiced_bt_mesh_onoff_server_callback_t</a>(uint8_t element_idx, uint16_t event, void *p_data)</td></tr>
<tr class="memdesc:ga2258b6d7a8870b9d5e45cb31aad8ab9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generic On/Off Server callback.  <a href="#ga2258b6d7a8870b9d5e45cb31aad8ab9b">More...</a><br /></td></tr>
<tr class="separator:ga2258b6d7a8870b9d5e45cb31aad8ab9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga43dd054acb66e75d3c82cca92034a6cf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__server.html#ga43dd054acb66e75d3c82cca92034a6cf">wiced_bt_mesh_model_onoff_server_init</a> (uint8_t element_idx, <a class="el" href="group__wiced__bt__mesh__onoff__server.html#ga2258b6d7a8870b9d5e45cb31aad8ab9b">wiced_bt_mesh_onoff_server_callback_t</a> *p_callback, uint32_t transition_interval, wiced_bool_t is_provisioned)</td></tr>
<tr class="memdesc:ga43dd054acb66e75d3c82cca92034a6cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">On/Off Server Module initialization.  <a href="#ga43dd054acb66e75d3c82cca92034a6cf">More...</a><br /></td></tr>
<tr class="separator:ga43dd054acb66e75d3c82cca92034a6cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae8407b3533ba16b322606715ecc95421"><td class="memItemLeft" align="right" valign="top">wiced_bool_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__server.html#gae8407b3533ba16b322606715ecc95421">wiced_bt_mesh_model_onoff_server_message_handler</a> (<a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *p_event, uint8_t *p_data, uint16_t data_len)</td></tr>
<tr class="memdesc:gae8407b3533ba16b322606715ecc95421"><td class="mdescLeft">&#160;</td><td class="mdescRight">On/Off Server Message Handler.  <a href="#gae8407b3533ba16b322606715ecc95421">More...</a><br /></td></tr>
<tr class="separator:gae8407b3533ba16b322606715ecc95421"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga183decc30f376b4a051c5a5a1752aa8d"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__server.html#ga183decc30f376b4a051c5a5a1752aa8d">wiced_bt_mesh_model_onoff_server_scene_store_handler</a> (uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len)</td></tr>
<tr class="memdesc:ga183decc30f376b4a051c5a5a1752aa8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">On/Off Server Scene Store Handler.  <a href="#ga183decc30f376b4a051c5a5a1752aa8d">More...</a><br /></td></tr>
<tr class="separator:ga183decc30f376b4a051c5a5a1752aa8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga695d902ada448311745f293913bdfa2d"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__server.html#ga695d902ada448311745f293913bdfa2d">wiced_bt_mesh_model_onoff_server_scene_recall_handler</a> (uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len, uint32_t transition_time, uint32_t delay)</td></tr>
<tr class="memdesc:ga695d902ada448311745f293913bdfa2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">On/Off Server Scene Recall Handler.  <a href="#ga695d902ada448311745f293913bdfa2d">More...</a><br /></td></tr>
<tr class="separator:ga695d902ada448311745f293913bdfa2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac632b3bcb0f941d86d1f4d0b9d92b2e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__server.html#gaac632b3bcb0f941d86d1f4d0b9d92b2e">wiced_bt_mesh_model_onoff_changed</a> (uint8_t element_idx, uint8_t onoff)</td></tr>
<tr class="memdesc:gaac632b3bcb0f941d86d1f4d0b9d92b2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">If On/Off state of the device can be changed locally, the application shall call this function to notify OnOff library that the value has been changed.  <a href="#gaac632b3bcb0f941d86d1f4d0b9d92b2e">More...</a><br /></td></tr>
<tr class="separator:gaac632b3bcb0f941d86d1f4d0b9d92b2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga9edfe8c8fd00ec622586f851f1735c18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9edfe8c8fd00ec622586f851f1735c18">&#9670;&nbsp;</a></span>WICED_BT_MESH_MODEL_ONOFF_SERVER</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WICED_BT_MESH_MODEL_ONOFF_SERVER</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_DEFTT_SRV, <a class="code" href="group__wiced__bt__mesh__default__transition__time__server.html#gaadbba5b7363b2afda149d73b56d0959d">wiced_bt_mesh_model_default_transition_time_server_message_handler</a>, NULL, NULL }, \</div><div class="line">    { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCENE_SRV, <a class="code" href="group__wiced__bt__mesh__scene__server.html#gad02139dbd5de33dbfa4574f1b7524817">wiced_bt_mesh_model_scene_server_message_handler</a>, NULL, NULL }, \</div><div class="line">    { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCENE_SETUP_SRV, <a class="code" href="group__wiced__bt__mesh__scene__server.html#ga1e69d93cd77b795bd811c1ae913a39e9">wiced_bt_mesh_model_scene_setup_server_message_handler</a>, NULL, NULL }, \</div><div class="line">    { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_ONOFF_SRV, <a class="code" href="group__wiced__bt__mesh__onoff__server.html#gae8407b3533ba16b322606715ecc95421">wiced_bt_mesh_model_onoff_server_message_handler</a>, <a class="code" href="group__wiced__bt__mesh__onoff__server.html#ga183decc30f376b4a051c5a5a1752aa8d">wiced_bt_mesh_model_onoff_server_scene_store_handler</a>, <a class="code" href="group__wiced__bt__mesh__onoff__server.html#ga695d902ada448311745f293913bdfa2d">wiced_bt_mesh_model_onoff_server_scene_recall_handler</a> }</div><div class="ttc" id="group__wiced__bt__mesh__onoff__server_html_ga695d902ada448311745f293913bdfa2d"><div class="ttname"><a href="group__wiced__bt__mesh__onoff__server.html#ga695d902ada448311745f293913bdfa2d">wiced_bt_mesh_model_onoff_server_scene_recall_handler</a></div><div class="ttdeci">uint16_t wiced_bt_mesh_model_onoff_server_scene_recall_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len, uint32_t transition_time, uint32_t delay)</div><div class="ttdoc">On/Off Server Scene Recall Handler.</div></div>
<div class="ttc" id="group__wiced__bt__mesh__default__transition__time__server_html_gaadbba5b7363b2afda149d73b56d0959d"><div class="ttname"><a href="group__wiced__bt__mesh__default__transition__time__server.html#gaadbba5b7363b2afda149d73b56d0959d">wiced_bt_mesh_model_default_transition_time_server_message_handler</a></div><div class="ttdeci">wiced_bool_t wiced_bt_mesh_model_default_transition_time_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)</div><div class="ttdoc">Default Transition Time Server Message Handler.</div></div>
<div class="ttc" id="group__wiced__bt__mesh__scene__server_html_ga1e69d93cd77b795bd811c1ae913a39e9"><div class="ttname"><a href="group__wiced__bt__mesh__scene__server.html#ga1e69d93cd77b795bd811c1ae913a39e9">wiced_bt_mesh_model_scene_setup_server_message_handler</a></div><div class="ttdeci">wiced_bool_t wiced_bt_mesh_model_scene_setup_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)</div><div class="ttdoc">Scene Setup Server Message Handler.</div></div>
<div class="ttc" id="group__wiced__bt__mesh__onoff__server_html_gae8407b3533ba16b322606715ecc95421"><div class="ttname"><a href="group__wiced__bt__mesh__onoff__server.html#gae8407b3533ba16b322606715ecc95421">wiced_bt_mesh_model_onoff_server_message_handler</a></div><div class="ttdeci">wiced_bool_t wiced_bt_mesh_model_onoff_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)</div><div class="ttdoc">On/Off Server Message Handler.</div></div>
<div class="ttc" id="group__wiced__bt__mesh__onoff__server_html_ga183decc30f376b4a051c5a5a1752aa8d"><div class="ttname"><a href="group__wiced__bt__mesh__onoff__server.html#ga183decc30f376b4a051c5a5a1752aa8d">wiced_bt_mesh_model_onoff_server_scene_store_handler</a></div><div class="ttdeci">uint16_t wiced_bt_mesh_model_onoff_server_scene_store_handler(uint8_t element_idx, uint8_t *p_buffer, uint16_t buffer_len)</div><div class="ttdoc">On/Off Server Scene Store Handler.</div></div>
<div class="ttc" id="group__wiced__bt__mesh__scene__server_html_gad02139dbd5de33dbfa4574f1b7524817"><div class="ttname"><a href="group__wiced__bt__mesh__scene__server.html#gad02139dbd5de33dbfa4574f1b7524817">wiced_bt_mesh_model_scene_server_message_handler</a></div><div class="ttdeci">wiced_bool_t wiced_bt_mesh_model_scene_server_message_handler(wiced_bt_mesh_event_t *p_event, uint8_t *p_data, uint16_t data_len)</div><div class="ttdoc">Scene Server Message Handler.</div></div>
</div><!-- fragment -->
<p>Mesh OnOff Server Device. </p>
<p>The model is used as a base for multiple other models. This device is typically not used standalone. The closest is Power OnOff Device which adds on power up behavior to the device and then can be used standalone. With the TIME_AND_SCHEDULER_SUPPORT the model TIME_CLNT is needed just to send TIME_GET message. Therefore message_handler is NULL. </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga2258b6d7a8870b9d5e45cb31aad8ab9b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2258b6d7a8870b9d5e45cb31aad8ab9b">&#9670;&nbsp;</a></span>wiced_bt_mesh_onoff_server_callback_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void() wiced_bt_mesh_onoff_server_callback_t(uint8_t element_idx, uint16_t event, void *p_data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generic On/Off Server callback. </p>
<p>The Generic On/Off Server callback is executed by the Mesh Models library on receiving a SET message from the peer. The callback is provided by the application or by the mesh model which extends the Generic On/Off server during the initialization.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">element_idx</td><td>Element Index of the model </td></tr>
    <tr><td class="paramname">event</td><td>The event that the application should process (see <a class="el" href="wiced__bt__mesh__models_8h.html#ONOFF_EVENT">On/Off Events</a>) </td></tr>
    <tr><td class="paramname">p_data</td><td>Pointer to the on/off state data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga43dd054acb66e75d3c82cca92034a6cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga43dd054acb66e75d3c82cca92034a6cf">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_server_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wiced_bt_mesh_model_onoff_server_init </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>element_idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__wiced__bt__mesh__onoff__server.html#ga2258b6d7a8870b9d5e45cb31aad8ab9b">wiced_bt_mesh_onoff_server_callback_t</a> *&#160;</td>
          <td class="paramname"><em>p_callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>transition_interval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wiced_bool_t&#160;</td>
          <td class="paramname"><em>is_provisioned</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>On/Off Server Module initialization. </p>
<p>The function shall be called to initialize the On/Off Server Module of the Mesh Models library. For multi element applications, the initialization shall be done for each element that supports on/off get, on/off set functionality.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">element_idx</td><td>Device element where OnOff model is used </td></tr>
    <tr><td class="paramname">p_callback</td><td>Application or Parent model callback that will be executed on receiving a message </td></tr>
    <tr><td class="paramname">transition_interval</td><td>Interval in milliseconds to update application during transition change with STATUS messages. If 0, library will send a single SET message when the transition should start. </td></tr>
    <tr><td class="paramname">is_provisioned</td><td>If TRUE, the application is being restarted after being provisioned or after a power loss. If FALSE, the device is unprovisioned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<a id="gae8407b3533ba16b322606715ecc95421"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae8407b3533ba16b322606715ecc95421">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_server_message_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wiced_bool_t wiced_bt_mesh_model_onoff_server_message_handler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *&#160;</td>
          <td class="paramname"><em>p_event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>On/Off Server Message Handler. </p>
<p>The Mesh Core library calls this function for each message received. This function is implemented by Mesh Models library and does not need to be replicated by the application or any other module. The function returns WICED_TRUE if the message is destined for this specific model, and returns WICED_FALSE otherwise. The function parses the message and if appropriate calls the parent to perform functionality.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_event</td><td>Mesh event with information about received message. </td></tr>
    <tr><td class="paramname">p_data</td><td>Pointer to the data portion of the message </td></tr>
    <tr><td class="paramname">data_len</td><td>Length of the data in the message</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WICED_TRUE if the message is for this company ID/Model/Element Index combination, WICED_FALSE otherwise. </dd></dl>

</div>
</div>
<a id="ga183decc30f376b4a051c5a5a1752aa8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga183decc30f376b4a051c5a5a1752aa8d">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_server_scene_store_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t wiced_bt_mesh_model_onoff_server_scene_store_handler </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>element_idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>buffer_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>On/Off Server Scene Store Handler. </p>
<p>The mesh Scene Server calls this function so that the module can store required data for the scene. The function is implemented in the Mesh Models library and does not need to be replicated by the application. To extend library functionality, the application can replace the function in the <a class="el" href="group__wiced__bt__mesh__onoff__server.html#ga9edfe8c8fd00ec622586f851f1735c18">WICED_BT_MESH_MODEL_ONOFF_SERVER</a>, performs its functionality and then call this function directly.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">element_idx</td><td>Element index for which scene information is being stored </td></tr>
    <tr><td class="paramname">p_buffer</td><td>Pointer to a buffer where data should be stored </td></tr>
    <tr><td class="paramname">buf_size</td><td>Maximum amount of data a model can store</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of bytes the model wrote into the provided buffer </dd></dl>

</div>
</div>
<a id="ga695d902ada448311745f293913bdfa2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga695d902ada448311745f293913bdfa2d">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_server_scene_recall_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t wiced_bt_mesh_model_onoff_server_scene_recall_handler </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>element_idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>buffer_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>transition_time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>delay</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>On/Off Server Scene Recall Handler. </p>
<p>When the Scene Server receives the Scene Recall message it calls this function with data previously stored in the NVRAM. The function is implemented in the Mesh Models library and does not need to be replicated by the application. To extend library functionality, the application can replace the function in the <a class="el" href="group__wiced__bt__mesh__onoff__server.html#ga9edfe8c8fd00ec622586f851f1735c18">WICED_BT_MESH_MODEL_ONOFF_SERVER</a>, performs its functionality and then call this function directly.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">element_idx</td><td>Element index for which scene information is being recalled </td></tr>
    <tr><td class="paramname">p_buffer</td><td>Pointer to a buffer where model's data is located </td></tr>
    <tr><td class="paramname">buf_size</td><td>Maximum amount of data a model can get from the buffer </td></tr>
    <tr><td class="paramname">transition_time</td><td>Specified time in milliseconds to transition to the target state </td></tr>
    <tr><td class="paramname">delay</td><td>Specifies time in milliseconds before starting to transition to the target state</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of bytes the model read from the provided buffer </dd></dl>

</div>
</div>
<a id="gaac632b3bcb0f941d86d1f4d0b9d92b2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaac632b3bcb0f941d86d1f4d0b9d92b2e">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_changed()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wiced_bt_mesh_model_onoff_changed </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>element_idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>onoff</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>If On/Off state of the device can be changed locally, the application shall call this function to notify OnOff library that the value has been changed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">element_idx</td><td>Element index for which onoff state has changed </td></tr>
    <tr><td class="paramname">onoff</td><td>New value of onoff</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Bluetooth LE Mesh Library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
</body>
</html>
